package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBusiMtnclientMapper;
import com.ruoyi.net.domain.ElementBusiMtnclient;
import com.ruoyi.net.service.IElementBusiMtnclientService;

/**
 * 网元-业务-mtnclientService业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBusiMtnclientServiceImpl implements IElementBusiMtnclientService 
{
    @Autowired
    private ElementBusiMtnclientMapper elementBusiMtnclientMapper;

    /**
     * 查询网元-业务-mtnclient
     * 
     * @param id 网元-业务-mtnclient主键
     * @return 网元-业务-mtnclient
     */
    @Override
    public ElementBusiMtnclient selectElementBusiMtnclientById(String id)
    {
        return elementBusiMtnclientMapper.selectElementBusiMtnclientById(id);
    }

    /**
     * 查询网元-业务-mtnclient列表
     * 
     * @param elementBusiMtnclient 网元-业务-mtnclient
     * @return 网元-业务-mtnclient
     */
    @Override
    public List<ElementBusiMtnclient> selectElementBusiMtnclientList(ElementBusiMtnclient elementBusiMtnclient)
    {
        return elementBusiMtnclientMapper.selectElementBusiMtnclientList(elementBusiMtnclient);
    }

    /**
     * 新增网元-业务-mtnclient
     * 
     * @param elementBusiMtnclient 网元-业务-mtnclient
     * @return 结果
     */
    @Override
    public int insertElementBusiMtnclient(ElementBusiMtnclient elementBusiMtnclient)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiMtnclient.getId())) {
            elementBusiMtnclient.setId(uuid);
        }
        elementBusiMtnclient.setCreateBy(SecurityUtils.getUsername());
        elementBusiMtnclient.setCreateTime(DateUtils.getNowDate());
        elementBusiMtnclient.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtnclient.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtnclientMapper.insertElementBusiMtnclient(elementBusiMtnclient);
    }

    /**
     * 修改网元-业务-mtnclient
     * 
     * @param elementBusiMtnclient 网元-业务-mtnclient
     * @return 结果
     */
    @Override
    public int updateElementBusiMtnclient(ElementBusiMtnclient elementBusiMtnclient)
    {
        elementBusiMtnclient.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtnclient.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtnclientMapper.updateElementBusiMtnclient(elementBusiMtnclient);
    }

    /**
     * 批量删除网元-业务-mtnclient
     * 
     * @param ids 需要删除的网元-业务-mtnclient主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtnclientByIds(String[] ids)
    {
        return elementBusiMtnclientMapper.deleteElementBusiMtnclientByIds(ids);
    }

    /**
     * 删除网元-业务-mtnclient信息
     * 
     * @param id 网元-业务-mtnclient主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtnclientById(String id)
    {
        return elementBusiMtnclientMapper.deleteElementBusiMtnclientById(id);
    }
}
